package company.meituan_F;

import java.util.Scanner;

public class M2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String[] start = new String[n];
        String[] end = new String[n];
        for (int i = 0; i < n; i++) {
            String s = sc.nextLine();
            String[] s1 = s.split(" ");
            start[i] = s1[0];
            end[i] = s1[1];
        }
        int result = 1;
        for (int i = 1; i < n; i++) {
            if (!start[i].equals(end[i - 1]))
                result++;
        }
        System.out.println(result);
    }
}
